#pragma once

#include <iostream>
#include <GL/glew.h>
#include "utilities.h"

class Shader
{
public:
		Shader();

		void Use();
		bool Initialize(char * vertex_shader_file, char * fragment_shader_file);
		void TakeDown();

		GLuint GetModelviewMatrixHandle();
		GLuint GetProjectionMatrixHandle();
		GLuint GetNormalMatrixHandle();
		GLuint GetMVPHandle();

		GLuint GetImageMapHandle();
		GLuint GetSizeHandle();
		GLuint GetSourceHandle();
		GLuint GetDestinationHandle();

	private:
		GLuint vertex_shader_id;
		GLuint fragment_shader_id;
		GLuint program_id;

		GLuint modelview_matrix_handle;
		GLuint projection_matrix_handle;
		GLuint normal_matrix_handle;
		GLuint mvp_handle;

		GLuint image_map_handle;
		GLuint size_handle;
		GLuint source_handle;
		GLuint destination_handle;

		bool CheckGLErrors();
		bool LoadShader(const char * file_name, GLuint shader_id);
};